package com.livew.framework.enums;

/**
 *  状态
 * @ClassName EStatus
 * @author wangdong
 * @Date 2018年1月11日 下午4:06:08
 * @version V1.0
 * @Description
 */
public enum EStatus {
	active("1","启用"),
	Disabled("2","禁用");
	
	private String code;
	
	private String desc;
	
	private EStatus(String code,String desc) {
		this.setCode(code);
		this.setDesc(desc);
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	
	public static String getDesc(String code) {
		for (EStatus e : EStatus.values()) {
			if (e.getCode().equals(code)) {
				return e.desc;
			}
		}
		return null;
	}
}
